/*
 * @Author: your name
 * @Date: 2021-06-04 15:18:16
 * @LastEditTime: 2021-06-04 15:23:58
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \bazai_island_api\app\models\classic.js
 */

const { Model, Sequelize } = require("sequelize");
const { sequelize } =  require('../../core/mysqlDB')

const classicFields = {
  image: Sequelize.STRING,
  content: Sequelize.STRING,
  pubdate: Sequelize.DATEONLY,
  fav_nums: {
    type: Sequelize.INTEGER,
    defaultValue: 0
  },
  type: Sequelize.TINYINT,
}

class Movie extends Model {
  
}

Movie.init(classicFields, {
  sequelize,
  tableName: 'movie'
})

class Sentence extends Model {
  
}

Sentence.init(classicFields, {
  sequelize,
  tableName: 'sentence'
})

class Music extends Model {
  
}

const musicFields = Object.assign({
  url: Sequelize.STRING
}, classicFields)

Music.init(musicFields, {
  sequelize,
  tableName: 'music'
})


module.exports = {
  Movie,
  Sentence,
  Music
}